

制作团队

    <?php foreach ($arr as $item):?>
    <div class="form-group zhedie1">

        <?php if ($item['fid'] != 99):?>

       <span style="display: inline-block; width: 150px ;" > <?= $item['name'] ?><?= $item['cid'] ?></span>
        <button class="shouqi" > 展开</button>
        <div style="display: none">
        <?php foreach ($item['Label'] as $k=> $l):?>
           <div> ├─<?= $item['name'] ?><?=  $k ?></div> 特征:
        <div class="dabiaoqian">
           <div class="biaoqian" style="display: inline-block">
<?= $l['user_bq']?>
            </div>

            <div class="form-group">
                <select class="form-control select" name="parent_id" data-id="<?= $item['cid'] ?>" data-xiabiao="<?= $k ?>"
                        data-pid="<?= $item['pid'] ?>"style="width: 300px">
                    <option value="0"> -选择添加- </option>


                </select>
<!--               <span class="selects" name="parent_id" data-id="--><?//= $item['cid'] ?><!--" data-xiabiao="--><?//= $k ?><!--" > +</span>-->
                <a href="<?= URL::site('plan/Reset?id='.$k.'&zhiye_id='.$item['cid']);?>" class="btn btn-info btn-xs ajax-modal-sm">重置特征</a>

            </div>
            </div>
        <?php endforeach;?>
            <hr>
        </div>
<!--        <a href="--><?//= URL::site('plan/delete2?name='.$item.'&id='.$pid);?><!--" class="btn btn-info btn-xs ">删除</a>-->
	</div>

        <?php else:?>
    <div>
            <span style="display: inline-block; width: 150px ;"><?= $item['name'] ?><?= $item['cid'] ?></span>
        <button class="shouqi" > 展开</button>
             <div style="display: none">
                <?php foreach ($item['Label'] as $k=> $l):?>
                    <div> ├─<?= $item['name'] ?><?= $k ?></div> 特征:
                    <div class="dabiaoqian">
                        <div class="biaoqian" style="display: inline-block">
                            <?= $l['user_bq']?>
                        </div>

                        <div class="form-group">
                            <select class="form-control select" name="parent_id" data-id="<?= $item['cid'] ?>" data-xiabiao="<?= $k ?>"
                                    data-pid="<?= $item['pid'] ?>"style="width: 300px">
                                <option value="0"> -选择添加- </option>


                            </select>
                            <!--               <span class="selects" name="parent_id" data-id="--><?//= $item['cid'] ?><!--" data-xiabiao="--><?//= $k ?><!--" > +</span>-->
                            <select class="form-control sex " name="sex" data-xiabiao="<?= $k ?>" data-id="<?= $item['cid'] ?>" data-pid="<?= $item['pid'] ?>" style="width: 300px" >
                                <option value="0" > -性别选择- </option>
                                <option value="1" <?php if($l['sex'] ==1) :?>selected="selected" <?php endif;?>> 男 </option>
                                <option value="2" <?php if($l['sex'] ==2) :?>selected="selected" <?php endif;?>> 女 </option>
                                <option value="3" <?php if($l['sex'] ==3) :?>selected="selected" <?php endif;?>> 未知 </option>
                            </select>
                            <select class="form-control age" name="age" data-xiabiao="<?= $k ?>" data-id="<?= $item['cid'] ?>" data-pid="<?= $item['pid'] ?>" style="width: 300px">
                                <option value="0"> -年龄选择- </option>
                                <option value="1" <?php if($l['sex'] ==1) :?>selected="selected" <?php endif;?>> 儿童 </option>
                                <option value="2" <?php if($l['sex'] ==2) :?>selected="selected" <?php endif;?>> 少年 </option>
                                <option value="3" <?php if($l['sex'] ==3) :?>selected="selected" <?php endif;?>> 青年 </option>
                                <option value="4" <?php if($l['sex'] ==4) :?>selected="selected" <?php endif;?>> 中年 </option>
                                <option value="5" <?php if($l['sex'] ==5) :?>selected="selected" <?php endif;?>> 中老年 </option>
                            </select>
                            <select class="form-control nationality" name="nationality"  data-xiabiao="<?= $k ?>" data-id="<?= $item['cid'] ?>" data-pid="<?= $item['pid'] ?>" style="width: 300px">
                                <option value="0"> -国籍选择- </option>
                                <option value="1" <?php if($l['sex'] ==1) :?>selected="selected" <?php endif;?>> 中国 </option>
                                <option value="2" <?php if($l['sex'] ==2) :?>selected="selected" <?php endif;?>> 美国 </option>
                                <option value="3" <?php if($l['sex'] ==3) :?>selected="selected" <?php endif;?>> 英国 </option>
                                <option value="4" <?php if($l['sex'] ==4) :?>selected="selected" <?php endif;?>> 日本 </option>
                                <option value="5" <?php if($l['sex'] ==5) :?>selected="selected" <?php endif;?>> 泰国 </option>
                                <option value="6" <?php if($l['sex'] ==6) :?>selected="selected" <?php endif;?>> 韩国 </option>
                                <option value="7" <?php if($l['sex'] ==7) :?>selected="selected" <?php endif;?>> 津巴布韦 </option>
                                <option value="8" <?php if($l['sex'] ==8) :?>selected="selected" <?php endif;?>> 其他 </option>
                            </select>
                            <a href="<?= URL::site('plan/Reset?id='.$k.'&zhiye_id='.$item['cid'].'&id='.$item['pid']);?>" class="btn btn-info btn-xs ajax-modal-sm">重置特征</a>

                        </div>
                    </div>
                <?php endforeach;?>
                <hr>
            </div>
            <!--        <a href="--><?//= URL::site('plan/delete2?name='.$item.'&id='.$pid);?><!--" class="btn btn-info btn-xs ">删除</a>-->
            </div>
            </div>
        <?php endif;?>
    <?php endforeach;?>

    <script>
        $(function () {
            $('.select').each(function () {
                $(this).one('click', function () {
                    var t = $(this);
                    var cid = $(this).data('id');
                    $.post('<?= URL::site('plan/select') ?>', {cid: cid}, function (res) {
                        res = JSON.parse(res)
                        for (let k in res) {
                            t.append("<option value='" + res[k].id + "'>" + res[k].tag + "</option>")
                        }
                    })
                }).trigger('click');


                $(this).change(function () {
                    let changeValue = $(this).val();
                    var t = $(this);
                    var xiabiao = $(this).data('xiabiao');
                    var zhiye_id = $(this).data('id');
                    var pid = $(this).data('pid');
                    var biaoqian = $(this).find('option:checked').text();
                    console.log(xiabiao)
                    $.post('<?= URL::site('plan/insert') ?>', {
                        cid: changeValue,
                        xiabiao: xiabiao,
                        zhiye_id: zhiye_id,
                        pid: pid
                    }, function (res) {
                        res = JSON.parse(res)
                        // console.log($(this))
                        if (res.errno == 1) {
                            t.parents('.dabiaoqian').find('.biaoqian').append(biaoqian + "-");
                        }
                    })
                })
            })

            $(function() {
                $('.sex').each(function () {
                    $(this).change(function () {
                        var t = $(this);
                        var cid = $(this).data('id');
                        var pid = $(this).data('pid');
                        var xiabiao = $(this).data('xiabiao');
                        var value = $(this).val();
                        console.log(value);
                        $.post('<?= URL::site('plan/sex') ?>', {
                            cid: cid,
                            pid: pid,
                            xiabiao: xiabiao,
                            val: value
                        }, function (res) {
                            console.log(res)

                        })
                    })
                })
            })
            $(function() {
                $('.age').each(function () {
                    $(this).change(function () {
                        var t = $(this);
                        var cid = $(this).data('id');
                        var pid = $(this).data('pid');
                        var xiabiao = $(this).data('xiabiao');
                        var value  = $(this).val();
                        console.log(value);
                        $.post('<?= URL::site('plan/age') ?>', {cid: cid,pid:pid,xiabiao:xiabiao,val:value}, function (res) {
                            console.log(res)

                        })
                    })
                })
            })
            $(function() {
                $('.nationality').each(function () {
                    $(this).change(function () {
                        var t = $(this);
                        var cid = $(this).data('id');
                        var pid = $(this).data('pid');
                        var xiabiao = $(this).data('xiabiao');
                        var value  = $(this).val();
                        console.log(value);
                        $.post('<?= URL::site('plan/nationality') ?>', {cid: cid,pid:pid,xiabiao:xiabiao,val:value}, function (res) {
                            console.log(res)

                        })
                    })
                })
            })

            $('body').on('click','.shouqi',function(){
                $(this).next().stop().slideToggle();
            })
        })



    </script>


